/**
    ATClab - scriptable Air Traffic Control simulations.
    Copyright (C) 2010 openatclab@gmail.com

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
**/

#ifndef __ATC_TRIALTASK_HDR__
#define __ATC_TRIALTASK_HDR__


#ifdef WIN32
	// disable 'identifier' truncation warning
	#pragma warning(disable:4786)
#endif


#include "task.h"
#include "taskfactory.h"
//Added by qt3to4:
#include <QShowEvent>

namespace atc{

	class Engine;

};


namespace pact{



	/*!
	 * \class pact::TrialTask
	 */
	class TrialTask : public pact::Task {
		Q_OBJECT

	public:
		static const char* MAIN_TARGET;

	public:
		TrialTask(pact::TrialTaskType a_type = pact::TRIAL_TASK_NORMAL);
		virtual ~TrialTask();

	public:
		atc::Engine * engine(){ return _engine; };
		void initialize();
		virtual void addTerminationTime( int );
		void set_timer( int, QObject *, const char * );

	public slots:
		void pause();
		void resume();

	protected: // virtual
		//virtual void keyPressEvent(QKeyEvent*);
		virtual void showEvent(QShowEvent *);

	signals:
		void started();
		void conflicts();

		void signal_start();
		void signal_pause();
		void signal_resume();
		void signal_end();
		
	private:
		atc::Engine*	_engine;
		pact::TrialTaskType	m_type;
	};

};


#endif
